package JUC;

import java.util.function.Consumer;

public class TestConsumer {
    public static void main(String[] args) {
        // Consumer<T>接口(消费型接口),只有参数，没有返回值，void类型
//        Consumer<String> myConsumer = new Consumer<String>() {
//            @Override
//            public void accept(String s) {
//                System.out.println(s);
//            }
//        };

        Consumer<String> myConsumer = s -> System.out.println(s);
        myConsumer.accept("jxc");
    }
}
